package com.qf.shopback.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.qf.entity.Goods;
import com.qf.fegin.api.IGoodsService;
import com.qf.resp.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    private IGoodsService goodsService;

    @RequestMapping("/getGoodsPage")
    public String getGoodsPage(Page<Goods>page, Model model){
        page=goodsService.getGoodsPage(page);
        return "goods/goodsList";

    }


    @RequestMapping("/addGoods")
    public ResultEntity addGoods(Goods goods){
        return goodsService.addGoods(goods);
    }
}
